package com.jihu.design.structural.flyweight;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 具体享元类
 * @author jihu
 * @date 2021/9/26
 */
@AllArgsConstructor
public class BeautifuWaitress extends AbstractWaitressFlyWeight {

    String id;//工号
    String name;//名字
    int age;//年龄
    //以上是不变的


    @Override
    void service() {
        System.out.println("工号:"+id+","+name+" "+age+" 正在为您服务......");

        this.canService = Boolean.FALSE;
    }

    @Override
    void end() {
        System.out.println("工号:"+id+","+name+" "+age+" 服务借宿......");

        this.canService = Boolean.TRUE;
    }
}
